import request from '@/utils/request'

// 钢种主数据 VO 定义（JavaScript 对象形式）
export const SteelGradeVO = {
  // 钢种ID
  id: 0,
  // 钢种编码
  steelGradeCode: '',
  // 钢种名称
  steelGradeName: '',
  // 业务状态
  busStatus: '',
  // 业务备注
  busMemo: '',
  // 创建时间
  createTime: null,
  // 预留字段
  reserveVarchar1: '',
  reserveVarchar2: '',
  reserveVarchar3: '',
  reserveVarchar4: '',
  reserveDecimal1: 0
}

// 钢种主数据 API
export const SteelGradeApi = {
  // 查询钢种主数据分页
  getSteelGradePage: function(params) {
    return request({
      method: 'get',
      url: '/qm/steel-grade/page',
      params: params
    })
  },

  // 查询钢种主数据详情
  getSteelGrade: function(id) {
    return request({
      method: 'get',
      url: '/qm/steel-grade/get?id=' + id
    })
  },

  // 新增钢种主数据
  createSteelGrade: function(data) {
    return request({
      method: 'post',
      url: '/qm/steel-grade/create',
      data: data
    })
  },

  // 修改钢种主数据
  updateSteelGrade: function(data) {
    return request({
      method: 'put',
      url: '/qm/steel-grade/update',
      data: data
    })
  },

  // 删除钢种主数据
  deleteSteelGrade: function(id) {
    return request({
      method: 'delete',
      url: '/qm/steel-grade/delete?id=' + id
    })
  },

  // 导出钢种主数据 Excel
  exportSteelGrade: function(params) {
    return request({
      method: 'get',
      url: '/qm/steel-grade/export-excel',
      params: params,
      responseType: 'blob'
    })
  },

  // 查询钢种主数据精简列表
  getSimpleList: function() {
    return request({
      method: 'get',
      url: '/qm/steel-grade/simple-list'
    })
  }
}

export default SteelGradeApi